function multiwave_cpu(file, seconds)
    if nargin < 2, seconds = 0; end
     if seconds == 0
        [y, Fs] = wavread(file);      % data= y, sampling freq = Fs
    else
        [y, Fs] = wavread(file,[1 44100*seconds]);      % data= y, sampling freq = Fs
    end
%[y, Fs] = wavread(file);      % y is sound data, Fs is sample frequency.
y = y(:,1);
lenY = length(y);
close all;
player = audioplayer(y,Fs);

t = (1:length(y))/Fs;         % time
h = figure;
set(h, 'Color', [.1,.1,.05]); %nackground color


h = gcf;

timeSkip = 350/44100;

myt = tic;

a= size(y);
lengthSong = a(1)/Fs;

history = []; %the buffer to keep for the past.
lastChanged = 1; %for the fading effect
numToRemember = 4; % length of history buffer

play(player);
numSeconds = 0;
while numSeconds<lengthSong
    tic;
    numSeconds = toc(myt);
    
   
    indnew = [ceil((numSeconds-timeSkip)*44100) ceil((numSeconds+timeSkip)*44100)];
    
    if (indnew(1) <= 0)
        indnew(1) = 1;
    end
    if (indnew(2) >= lenY)
        indnew(2)= lenY;
    end
    ind = [indnew(1):indnew(end)];
    if length(ind) == 0
        break;
    end
    upperlimit = max(y(ind));
    handle = plot(y(ind));
    set(handle, 'Color', [1,1,1], 'LineWidth',6);
    hold on;
    
    
    ylim([upperlimit*-2 upperlimit*2]);
    
    [a b] = size(history);
    
    for i=1:b
        p = plot(history(:,i));
        set(p,'Color',[1,1,1],'LineWidth',1);
        %hold on;
    end
    hold off;
    [c d] = size(y(ind));
    if c == 701
        [a b] = size(history);
        if b<numToRemember
            history = horzcat(history, y(ind));
        else
            history(:,lastChanged) = y(ind);
            lastChanged=lastChanged+1;
            if lastChanged == numToRemember+1
                lastChanged = 1;
            end
            
        end %end if statement
        
    end %end making surte we're adding the same length
    
    axis off
    pause(.1);
    
    toc;
end
